{% extends "stories/base.html" %}
{% load i18n %}

{% block head_title %}Story List{% endblock %}

{% block subnav %}
    <h2>{% trans "Links" %}</h2>
    <ul class="action-links">
        <li><a href="{% url stories_add_story %}" title="Add Story">Add Story</a></li>
    </ul>
{% endblock %}

{% block main_content %}
    <h1>Stories</h1>

    {% if stories %}
        {% for story in stories %}
        <div class="story-list-item {% cycle '' 'alt-row' %}">
            <h2><a href="{% url stories_story_pages story.id %}">{{ story.headline }}</a></h2>
            <img src="{{ story.lead_art.get_thumbnail_url }}" />
            {% for p in story.pages %}
            <a href="{% url stories_story_pages story.id %}?page={{ p.id }}">{{ p.pagenum }}</a>
            {% endfor %}
            <p>{{ story.modified|date:"fa F jS, Y" }}</p>
        </div>
        {% endfor %}
    {% else %}
    <p>No stories available yet.</p>
    {% endif %}

{% endblock %}
